//
//  RootViewController.m
//  project
//
//  Created by 张峥 on 16/7/21.
//  Copyright © 2016年 张峥. All rights reserved.
//

#import "RootViewController.h"
#import "ZZTabViewController.h"
#import "ZZConfig.h"

@interface RootViewController ()
@property (nonatomic, strong) UIImageView        *ZZNav;

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor purpleColor];
    ZZTabViewController *zztabVC = [[ZZTabViewController alloc] init];
    [self addChildViewController:zztabVC];
    [self creatZNav];
   }

- (void)creatZNav{
    _ZZNav = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 80)];
    _ZZNav.image = [UIImage imageNamed:@"眉头_01"];
    [self.view addSubview:_ZZNav];
    
    UIImageView *headImage = [[UIImageView alloc] initWithFrame:CGRectMake(20, 10, 55, 55)];
    headImage.image = [UIImage imageNamed:@"头像_11"];
    [_ZZNav addSubview:headImage];
}

//重写添加子控制器方法
- (void)addChildViewController:(UIViewController *)childController
{
    [super addChildViewController:childController];
    [self.view addSubview:childController.view];
    //这句话什么意思不是很懂
    [childController didMoveToParentViewController:self];
}



@end
